#include <iostream>
#include "tplast.h"
#include <chrono>
using namespace std;

int main() {
    cout << thread::hardware_concurrency() << endl;
    ThreadPool2 pool;
    pool.ResetMode(PoolMode::cached);
    pool.Start(4);
    future<int> res = pool.submitTask([]()->int{
        cout << "start " << this_thread::get_id() << endl;
        this_thread::sleep_for(chrono::seconds(4));
        cout << "end " << this_thread::get_id() << endl;
        return 100;
    });
    int a = res.get();
    cout << a << endl;
    return 0;
}
